import Vue from 'vue'
import router from '@/router/index' //导入路由文件
Vue.directive('permission', {


  // 自定义指令
  inserted: function (el, binding) {
    const action = binding.value.action //拿到指令绑定的数据
    // console.log(action, '我是指令绑定值')
    const currentRight = router.currentRoute.meta.buttonArry //路由权限的数组
    // console.log(currentRight, '我是当前路由的按钮权限值')
    if (currentRight) {
      if (currentRight.indexOf(action) == -1) { //没找到的时候
        // console.log('我删除了')
        el.parentNode.removeChild(el)
      }

    }

  }

})